<template>
	<view class="videos">


		<button type="warn" size="mini" @click="changeIndex">上一个</button>
		<view v-if="index===1">
			<view>好东西1(下滑下一个视频)</view>
			<video class="video" id="myVideo" src="http://47.93.130.192:8088/videos/avid5d3973a293ee2.mp4" @error="videoErrorCallback"
			 enable-danmu danmu-btn controls autoplay>
			</video>
		</view>



		<view v-if="index===2">
			<view>
				<view>好东西2(下滑下一个视频)</view>
				<video class="video" id="myVideo" src="http://47.93.130.192:8088/videos/avid5bd67bf33523c.mp4" @error="videoErrorCallback"
				 enable-danmu danmu-btn controls autoplay>
				</video>
			</view>
		</view>

		<view v-if="index===3">
			<view>好东西3(下滑下一个视频)</view>
			<video class="video" id="myVideo" src="http://47.93.130.192:8088/videos/3gIlPeep.mp4" @error="videoErrorCallback"
			 enable-danmu danmu-btn controls autoplay>
			</video>
		</view>



		<view v-if="index===4">
			<view>好东西4(下滑下一个视频)</view>
			<video class="video" id="myVideo" src="http://47.93.130.192:8088/videos/61066fb2f72b0c9c5dd38ee9665bb62b.mp4" @error="videoErrorCallback"
			 enable-danmu danmu-btn controls autoplay>
			</video>
		</view>

		<view v-if="index===5">
			<view>好东西5(下滑下一个视频)</view>
			<video class="video" id="myVideo" src="http://47.93.130.192:8088/videos/3911e8da4e64b32dfca2fe8dd3552318.mp4" @error="videoErrorCallback"
			 enable-danmu danmu-btn controls autoplay>
			</video>
		</view>

		<view v-if="index===6">
			<view>好东西6(下滑下一个视频)</view>
			<video class="video" id="myVideo" src="http://47.93.130.192:8088/videos/809ca113e1438c5a277dcdbfb808cc59.mp4" @error="videoErrorCallback"
			 enable-danmu danmu-btn controls autoplay>
			</video>
		</view>

		<view v-if="index===7">
			<view>好东西7(下滑下一个视频)</view>
			<video class="video" id="myVideo" src="http://47.93.130.192:8088/videos/91_263a77ecbd0f4edbba0743b65838eda4.mp4"
			 @error="videoErrorCallback" enable-danmu danmu-btn controls autoplay>
			</video>
		</view>

		<view v-if="index===8">
			<view>好东西8(下滑下一个视频)</view>
			<video class="video" id="myVideo" src="http://47.93.130.192:8088/videos/5nOoP5JP.mp4" @error="videoErrorCallback"
			 enable-danmu danmu-btn controls autoplay>
			</video>
		</view>

		<view v-if="index===9">
			<view>好东西9(下滑下一个视频)</view>
			<video class="video" id="myVideo" src="http://47.93.130.192:8088/videos/MpoTSa2G.mp4" @error="videoErrorCallback"
			 enable-danmu danmu-btn controls autoplay>
			</video>
		</view>

		<view v-if="index===10">
			<view>好东西10(下滑下一个视频)</view>
			<video class="video" id="myVideo" src="http://47.93.130.192:8088/videos/80f7cf5a4ce46851f647c9c4601815e6.mp4" @error="videoErrorCallback"
			 enable-danmu danmu-btn controls autoplay>
			</video>
		</view>

		<view v-if="index===11">
			<view>好东西11(下滑下一个视频)</view>
			<video class="video" id="myVideo" src="http://47.93.130.192:8088/videos/cut_020905_10_0_3.mp4" @error="videoErrorCallback"
			 enable-danmu danmu-btn controls autoplay>
			</video>
		</view>

		<view v-if="index===12">
			<view>好东西12(下滑下一个视频)</view>
			<video class="video" id="myVideo" src="http://47.93.130.192:8088/videos/avid5bb198658cab1.mp4" @error="videoErrorCallback"
			 enable-danmu danmu-btn controls autoplay>
			</video>
		</view>

		<view v-if="index===13">
			<view>好东西13(下滑下一个视频)</view>
			<video class="video" id="myVideo" src="http://47.93.130.192:8088/videos/avid5bb198668d63c.mp4" @error="videoErrorCallback"
			 enable-danmu danmu-btn controls autoplay>
			</video>
		</view>

		<view v-if="index===14">
			<view>好东西14(下滑下一个视频)</view>
			<video class="video" id="myVideo" src="http://47.93.130.192:8088/videos/avid5bb1986c29e3b.mp4" @error="videoErrorCallback"
			 enable-danmu danmu-btn controls autoplay>
			</video>
		</view>

		<view v-if="index===15">
			<view>好东西15(下滑下一个视频)</view>
			<video class="video" id="myVideo" src="http://47.93.130.192:8088/videos/avid5bb1986f90c23.mp4" @error="videoErrorCallback"
			 enable-danmu danmu-btn controls autoplay>
			</video>
		</view>

		<view v-if="index===16">
			<view>好东西16(下滑下一个视频)</view>
			<video class="video" id="myVideo" src="http://47.93.130.192:8088/videos/50313_3.mp4" @error="videoErrorCallback"
			 enable-danmu danmu-btn controls autoplay>
			</video>
		</view>

		<view v-if="index===17">
			<view>好东西17(下滑下一个视频)</view>
			<video class="video" id="myVideo" src="http://47.93.130.192:8088/videos/ttkH9Dxw.mp4" @error="videoErrorCallback"
			 enable-danmu danmu-btn controls autoplay>
			</video>
		</view>

		<view v-if="index===18">
			<view>好东西18(下滑下一个视频)</view>
			<video class="video" id="myVideo" src="http://47.93.130.192:8088/videos/jOnMEIa6.mp4" @error="videoErrorCallback"
			 enable-danmu danmu-btn controls autoplay>
			</video>
		</view>

		<view v-if="index===19">
			<view>好东西19(下滑下一个视频)</view>
			<video class="video" id="myVideo" src="http://47.93.130.192:8088/videos/7DL8RM0C.mp4" @error="videoErrorCallback"
			 enable-danmu danmu-btn controls autoplay>
			</video>
		</view>

		<view v-if="index===20">
			<view>好东西20(下滑下一个视频)</view>
			<video class="video" id="myVideo" src="http://47.93.130.192:8088/videos/GRgaf5Vf.mp4" @error="videoErrorCallback"
			 enable-danmu danmu-btn controls autoplay>
			</video>
		</view>




	</view>
</template>

<script>
	export default {
		data() {
			return {
				index: 1
			}
		},
		methods: {
			videoErrorCallback() {

			},
			changeIndex() {
				this.index--
				if (this.index < 1) {
					this.index = 1
					return uni.showToast({
						title: '已是第一个视频'
					})
				}
			}
		},
		onPullDownRefresh() {
			this.index++
			if (this.index > 20) {
				this.index = 20
				uni.stopPullDownRefresh()
				return uni.showToast({
					title: '已是最后一个视频'
				})
			}
			uni.stopPullDownRefresh()
		}

	}
</script>

<style lang="scss">
	.videos {
		video {
			width: 100%;
			height: 580px;
			// #ifdef APP-PLUS
			height: 620px;
			// #endif
		}

		button {
			position: absolute;
			top: 20;

		}

		view {
			text-align: center;
		}

		text {

			margin: 10rpx 0;
			font-size: 20px;
		}
	}
</style>
